package org.jeecg.modules.business.outbound.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.business.outbound.entity.WmsOutReceiptTask;
import org.jeecg.modules.business.outbound.entity.dto.ListWmsOutReceiptDTO;
import org.jeecg.modules.business.outbound.entity.vo.RepertorySimpleVO;
import org.jeecg.modules.business.outbound.entity.vo.WmsOutReceiptTaskPageVO;
import org.jeecg.modules.business.outbound.entity.vo.WmsOutReceiptTaskQueryVO;

import java.util.List;

/**
 * @Description: 出库任务
 * @Author: jeecg-boot
 * @Date: 2023-08-09
 * @Version: V1.0
 */
public interface WmsOutReceiptTaskMapper extends BaseMapper<WmsOutReceiptTask> {

    /**
     * 出库任务下查
     *
     * @param wmsOutReceiptId
     * @return
     */
    ListWmsOutReceiptDTO listWmsOutReceipt(@Param("wmsOutReceiptId") String wmsOutReceiptId, @Param("documentStatus") String documentStatus);

    IPage<WmsOutReceiptTaskPageVO> getPage(@Param("page") IPage<WmsOutReceiptTask> page, @Param("vo") WmsOutReceiptTaskQueryVO wmsOutReceiptTask);

    /**
     * 获取物料即时库存位置信息
     *
     * @param wmsBasicMaterialId
     * @param batchCode
     * @param wmsBasicWarehouseId
     * @return
     */
    List<RepertorySimpleVO> getMaterialRepertoryInfo(@Param("materialId") String wmsBasicMaterialId,
                                                     @Param("batchCode") String batchCode,
                                                     @Param("wmsBasicWarehouseId") String wmsBasicWarehouseId,
                                                     @Param("wmsBasicWarehouseAreaId") String wmsBasicWarehouseAreaId);

    /**
     * 使用次数最多的库区
     *
     * @return
     */
    List<String> listMaxArea(String taskId);

    /**
     * 根据任务物料id获取vo
     * @param taskMaterialId
     * @return
     */
    RepertorySimpleVO getRepertorySimpleVOByTaskMaterialId(@Param("taskMaterialId") String taskMaterialId);
}
